<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>用户管理3</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {
		$("#btnExport").click(function() {
			top.$.jBox.confirm("确认要导出用户数据吗？", "系统提示", function(v, h, f) {
				if (v == "ok") {
					$("#searchForm").attr("action", "${ctx}/sys/user/export");
					$("#searchForm").submit();
				}
			}, {
				buttonsFocus : 1
			});
			top.$('.jbox-body .jbox-icon').css('top', '55px');
		});
		$("#btnImport").click(function() {
			$.jBox($("#importBox").html(), {
				title : "导入数据",
				buttons : {
					"关闭" : true
				},
				bottomText : "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
			});
		});
	});
	function page(n, s) {
		if (n)
			$("#pageNo").val(n);
		if (s)
			$("#pageSize").val(s);
		var activityName = $("#activityId").val().trim();
		$("#mactivityId").val(activityName);
		var mmsProvinId = $("#mmsProvinId").val().trim();
		$("#mProvinId").val(mmsProvinId);
		var mmsCityId = $("#mmsCityId").val().trim();
		$("#mCityId").val(mmsCityId);
		var mmsGroupId = $("#mmsGroupId").val().trim();
		$("#mGroupId").val(mmsGroupId);
		$("#searchForm").attr("action", "${ctx}/mms/statistics/orderList");
		$("#searchForm").submit();
		return false;
	}
	function getMmsProvin() {
		var id = $("#mmsProvinId").val();
		$("#searchForm").attr(
				"action",
				"${ctx}/mms/statistics/orderList?provinId=" + id + "&t="
						+ new Date().getTime());
		$("#searchForm").submit();
	}
</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/sys/user/import" method="post"
			enctype="multipart/form-data" class="form-search"
			style="padding-left: 20px; text-align: center;"
			onsubmit="loading('正在导入，请稍等...');">
			<br /> <input id="uploadFile" name="file" type="file"
				style="width: 330px" /><br /> <br /> <input id="btnImportSubmit"
				class="btn btn-primary" type="submit" value="   导    入   " /> <a
				href="${ctx}/sys/user/import/template">下载模板</a>
		</form>
	</div>
		<form id="searchForm" modelAttribute="mmsProvince"
		action="${ctx}/mms/statistics/orderList" method="post"
		class="breadcrumb form-search ">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<input id="mProvinId" name="provinId" type="hidden" value=""/>
			<input id="mCityId" name="mCityName" type="hidden" value=""/>
			<input id="mactivityId" name="activityName" type="hidden" value=""/>
			<input id="mGroupId" name="groupId" type="hidden" value=""/>
		<ul class="ul-form">
			<li><label>活动名称：</label> 
			<input maxlength="50" type="text" class="input-medium" id="activityId"/></li>
			<li><label>省份：</label> 
				<select onchange="getMmsProvin()" id="mmsProvinId" class="input-medium" >
					<option value="">--请选择--</option>
					<c:forEach items="${map.mmsProList}" var="pro">
						<option value="${pro.id }" <c:if test="${provinId eq pro.id}">selected="selected"</c:if>>${pro.name}</option>
					</c:forEach>
				</select>
			</li>
			<li><label>城市：</label>
				<select class="input-medium" id="mmsCityId">
					<option value="">--请选择--</option>
					<c:forEach items="${map.mmsCityList}" var="city">
						<option value="${city.id }" <c:if test="${mCityName eq city.id}">selected="selected"</c:if>>${city.name}</option>
					</c:forEach>
				</select>
			 </li>
			<li><label>所属组：</label> 
				<select class="input-medium" id="mmsGroupId">
					<option value="">--请选择--</option>
					<c:forEach items="${map.mmsGList}" var="group">
						<option value="${group.id }" >${group.name}</option>
					</c:forEach>
				</select>
			</li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" onclick="return page();" />
			<li class="clearfix"></li>
		</ul>
	</form>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/mms/statistics/orderList?flag=1">领取资料信息</a></li>
		<li><a href="${ctx}/mms/statistics/orderList?flag=2">订单信息</a></li>
	</ul>
<%-- 	<form id="searchForm" modelAttribute="mmsProvince"
		action="${ctx}/mms/statistics/orderList" method="post"
		class="breadcrumb form-search ">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
			<input id="mProvinId" name="provinId" type="hidden" value=""/>
			<input id="mCityId" name="mCityName" type="hidden" value=""/>
			<input id="mactivityId" name="activityName" type="hidden" value=""/>
		<ul class="ul-form">
			<li><label>活动名称：</label> 
			<input maxlength="50" type="text" class="input-medium" id="activityId"/></li>
			<li><label>省份：</label> 
				<select onchange="getMmsProvin()" id="mmsProvinId" class="input-medium" >
					<option value="">--请选择--</option>
					<c:forEach items="${map.mmsProList}" var="pro">
						<option value="${pro.id }" <c:if test="${provinId eq pro.id}">selected="selected"</c:if>>${pro.name}</option>
					</c:forEach>
				</select>
			</li>
			<li><label>城市：</label>
				<select class="input-medium" id="mmsCityId">
					<option value="">--请选择--</option>
					<c:forEach items="${map.mmsCityList}" var="city">
						<option value="${city.id }" <c:if test="${mCityName eq city.id}">selected="selected"</c:if>>${city.name}</option>
					</c:forEach>
				</select>
			 </li>
			<li><label>所属组：</label> 
				<select class="input-medium" >
					<option id=""></option>
				</select>
			</li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" onclick="return page();" />
			<li class="clearfix"></li>
		</ul>
	</form> --%>
	<div style="margin-top:8px;">
			<label>领取时间：&nbsp;</label><input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="<fmt:formatDate value="${log.beginDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			<label>&nbsp;--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label><input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="input-mini Wdate"
				value="<fmt:formatDate value="${log.endDate}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
		</div>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>订单ID</th>
				<th>领取时间</th>
				<th>学员用户名</th>
				<th>是否新用户</th>
				<th>手机号</th>
				<th>二维码编号</th>
				<th>二维码类型</th>
				<th>组名称</th>
				<th>位置</th>
				<th>活动名称</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="scann">
				<tr>
					<td>
						${scann.id}
					</td>
					<td>
						<fmt:formatDate value="${scann.createTime}" type="both"/>
					</td>
					<td>
						${scann.userName}
					</td>
					<td>
						${scann.isNewType}
					</td>
					<td>
						${scann.tele}
					</td>
					<td>
						${scann.qrId}
					</td>
					<td>
						${scann.qrType}
					</td>
					<td>
						${scann.groupName}
					</td>
					<td>
						${scann.groupProvinceName} > ${scann.groupCityName} 
					</td>
					<td>
						${scann.activityName}
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
		<div class="pagination">${page}</div>
</body>
</html>